UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '25fNBMlR5PuXrbu3TNRSf7fs/3ChvhcX4NzKyKhzneg=' 
WHERE 
  key_id = 'a265f7a5eee0bbeb4b22d95a796c42f3591bd2dd6fae78774a6518ff4a4bc982' 
  AND (
    token = '25fNBMlR5PuXrbu3TNRSf7fs/3ChvhcX4NzKyKhzneg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056