UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7C5YnlswkS6VZM6Sl2Se9TL+hDwHb1S66uZAyJnOOuA=' 
WHERE 
  key_id = '92c42fea77748486a2f04a0c3abfce1b12b024f2bead7338d717b5ed40ae03ba' 
  AND (
    token = '7C5YnlswkS6VZM6Sl2Se9TL+hDwHb1S66uZAyJnOOuA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026