UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CxF9lkYbRmiibM3/yY2ghr56LBp0I/OifJn3gnNc2Zo=' 
WHERE 
  key_id = '4a14922c64e86f45797079e2902d2b37d9c7c25f27e7aec24d1f41f56a61159a' 
  AND (
    token = 'CxF9lkYbRmiibM3/yY2ghr56LBp0I/OifJn3gnNc2Zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042