UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uvGFt1hP6vBBoRfhOP8pyV6xuG3j4xS/R4VNVyAobbM=' 
WHERE 
  key_id = '0ba1e13b06eef8454a93c846835d4c1658c49b08fb55cf6d7ce0d4206979d133' 
  AND (
    token = 'uvGFt1hP6vBBoRfhOP8pyV6xuG3j4xS/R4VNVyAobbM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049