UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ws+kv0+KiKLXdtW9domuPqkNzMyJnrU2NVeFEfOANgI=' 
WHERE 
  key_id = 'd1db8e19ef1992c68eb57223b3881d76df282fe3530e0cfbff13d60f95afd9c7' 
  AND (
    token = 'Ws+kv0+KiKLXdtW9domuPqkNzMyJnrU2NVeFEfOANgI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030