UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uxdqHJiAnpXrA0tCqjKZtCM7m2K3W9NBcmKnfhMw2ro=' 
WHERE 
  key_id = '0578b2548f71ceac1f2e3501c5a5e8e557c2c7276cac837bc04052a4bdf3dec2' 
  AND (
    token = 'uxdqHJiAnpXrA0tCqjKZtCM7m2K3W9NBcmKnfhMw2ro=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016