UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '18uJib521/D8/3gzJSMl5PlUBg+6qwZQpOrfGT3/oYg=' 
WHERE 
  key_id = 'b8de5add27ccbcc108da0aca4e19280e13eab13ad5b021ee76bbef25238a2f32' 
  AND (
    token = '18uJib521/D8/3gzJSMl5PlUBg+6qwZQpOrfGT3/oYg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027