UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p3ubRQP2Y88glDH/dJ/LVIC/m1ViKLo3HA9SgGn4B34=' 
WHERE 
  key_id = '2006a897f848da24e1ec8c59e46edcae9c87f75d7b8b7443220eaa03cb074ff4' 
  AND (
    token = 'p3ubRQP2Y88glDH/dJ/LVIC/m1ViKLo3HA9SgGn4B34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026