UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jH+PWyW5H0Btpvz20KjC5eB1tBuSMc20N3Ho2pq3DfQ=' 
WHERE 
  key_id = 'e4abcaa1da3a2504a21e8b4ad48c6a69b7d2fa3ae6bdc28cef72163915ee4005' 
  AND (
    token = 'jH+PWyW5H0Btpvz20KjC5eB1tBuSMc20N3Ho2pq3DfQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025