UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ecl5rdG11qpAr+s+NG92HttaFVJHCdhMkIGJ+eA0g+E=' 
WHERE 
  key_id = '6feef1fa182a05acf0e19cdd9a2c8c976f67b5b8c2f0a796c6c6993bfedcfaee' 
  AND (
    token = 'Ecl5rdG11qpAr+s+NG92HttaFVJHCdhMkIGJ+eA0g+E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036