UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sUkJiC4XyeR3RA45W2wDUpZbDkLFm4djZ4OcpcOLs3c=' 
WHERE 
  key_id = 'a8c17a700b7efd8c5a310ff8d6173be74c9c75321589eaf11fed5bffe8bd56e5' 
  AND (
    token = 'sUkJiC4XyeR3RA45W2wDUpZbDkLFm4djZ4OcpcOLs3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00117