UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+t/qCEFaEtosn4LgE5RN6nxfH2UkNNTH4w7A+t4wHGk=' 
WHERE 
  key_id = '49661350fec7d50c4d5b20ee4006bc066f7848a7e5d0b17f1a32cc3bf61f0d25' 
  AND (
    token = '+t/qCEFaEtosn4LgE5RN6nxfH2UkNNTH4w7A+t4wHGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032