UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4EE5a/L1MhC9M8UJ/LJ2RP5Ij8VQ8E8nOLetEd2pAdI=' 
WHERE 
  key_id = '9915febdcd70cce8e8b3889adc79cab83eefcfcf5bf87a3da180878c09fe9d28' 
  AND (
    token = '4EE5a/L1MhC9M8UJ/LJ2RP5Ij8VQ8E8nOLetEd2pAdI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031