UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wpa0j/Xbp1MTmFDdqLE/eNB9N9Lcywp53c4dypLHxZ0=' 
WHERE 
  key_id = 'b34fe694746e8bee3d4f9e63f0d8de3083b07e3ee47adef10a0af98fb9bcd585' 
  AND (
    token = 'wpa0j/Xbp1MTmFDdqLE/eNB9N9Lcywp53c4dypLHxZ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048