UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q83xGk7FokpfWWB0U3I8gemsJcThFdCD/rC1oQ5BJIc='
WHERE
key_id = '470cbc55f9a7d1e1a06dc2cbd30234d6276eba60f924d332156e981b6ab8c85b'
AND (
token = 'q83xGk7FokpfWWB0U3I8gemsJcThFdCD/rC1oQ5BJIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)