UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OqDFMYhDzvwG+JP2dP10wKHgr2QjFQv10JLXQM2zbM4='
WHERE
key_id = 'b59650d19abda45832e1d4cf19bcc57264781fb56e586205226bb1c536be48c4'
AND (
token = 'OqDFMYhDzvwG+JP2dP10wKHgr2QjFQv10JLXQM2zbM4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)