UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xk1619EG8T3mv98Kq9zQQGGcfOtxe9GcIC3cqZiWBak=' 
WHERE 
  key_id = '6361c1485e44a79d3ac882058f09f48abba90f7f9b6d00fbbe451cd10717c69b' 
  AND (
    token = 'xk1619EG8T3mv98Kq9zQQGGcfOtxe9GcIC3cqZiWBak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029