UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zKUJQjYC9vqKFw78GqB/eAjFIVs2N2eoLkM76Nhxm2o=' 
WHERE 
  key_id = 'f08616cd54289a7561927f970c52da592c1512cb03034439b2b027ae72657152' 
  AND (
    token = 'zKUJQjYC9vqKFw78GqB/eAjFIVs2N2eoLkM76Nhxm2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022