UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IXv3nMYsODpXOrusoNRb5yIJ8OEkRzICXlqsr0TJf/Y=' 
WHERE 
  key_id = '4e1f65350f272b1592eb56dd8c8f5298532ef2a8565caefa772f0f924f56c7ee' 
  AND (
    token = 'IXv3nMYsODpXOrusoNRb5yIJ8OEkRzICXlqsr0TJf/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029