UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BZOBh8gZ6+DMihDLA48HuUJHkRc5u/9qNToD0JGQXcQ=' 
WHERE 
  key_id = '26f35e89f811fdf00e65de13f9da718e010187cd053eb67a7874c395b9941a11' 
  AND (
    token = 'BZOBh8gZ6+DMihDLA48HuUJHkRc5u/9qNToD0JGQXcQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027