UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hQqk2nuPw7BPechfOt+vjk0MiFiD27Qhlg8X8fbCtr0='
WHERE
key_id = 'c76942d4ba9051c6acf0b4bf673e9062d46720ef590feae73394308249ddc06c'
AND (
token = 'hQqk2nuPw7BPechfOt+vjk0MiFiD27Qhlg8X8fbCtr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)