UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zLh86PNQE4Tkm/XblfbQYdPb6+dswpfjd5iL3WVjTVM=' 
WHERE 
  key_id = 'ccbb92a7686ac653c149a4b878ee400cf055f0758fa9c507f4df84d87a7b1f18' 
  AND (
    token = 'zLh86PNQE4Tkm/XblfbQYdPb6+dswpfjd5iL3WVjTVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032