UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6FfF6+Vj50LXOn2V7MxR0Owmvhu5q+2OrazqclXbtT0=' 
WHERE 
  key_id = '0003aecdca1a4bb76067fa93e8ab22a85ea3ad5d89fd15c11e57803e58c7f379' 
  AND (
    token = '6FfF6+Vj50LXOn2V7MxR0Owmvhu5q+2OrazqclXbtT0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034