UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4BPFatXge/VSDPN/2BptvSg9O29wqN07Yn9+1h2gMII='
WHERE
key_id = '80de4f0cff0ae6d795f86f22340344c10e96e29d7a2ab173c3e614c78aa2f798'
AND (
token = '4BPFatXge/VSDPN/2BptvSg9O29wqN07Yn9+1h2gMII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)