UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JXRhb8nPoDevR8AAjgqJuLFVDcrEHgDpzidq6PVG/y0=' 
WHERE 
  key_id = '15601711e74796b3a1fc23dc41a1c1a175c459207de458aa117dd13ef3145cf5' 
  AND (
    token = 'JXRhb8nPoDevR8AAjgqJuLFVDcrEHgDpzidq6PVG/y0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037