UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eQ+nKubmqpc7x1KgDnERQ8yi1pOIXGKzvKTtVcm4QgQ=' 
WHERE 
  key_id = '078f24d1a3db6136dc05dd608587042c322797db9b52a8fd229f5cec1ff5aea0' 
  AND (
    token = 'eQ+nKubmqpc7x1KgDnERQ8yi1pOIXGKzvKTtVcm4QgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053