UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RCDqcp8AVJVxq75V2LH9RpvENjg/mJoGcUzaA01gS9k=' 
WHERE 
  key_id = '37dc8672ebce85961389d6d6660307f250afe7cdb76420d1e1e642c6fffb24ca' 
  AND (
    token = 'RCDqcp8AVJVxq75V2LH9RpvENjg/mJoGcUzaA01gS9k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017