UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U9O23Z6ua1sLyLvJw6A2uhsh6SS6UfpEd+imXfFbWKs='
WHERE
key_id = '0a5dc741a101ea015086b255f72d5d574890db203072893d052bc347e81d1a9c'
AND (
token = 'U9O23Z6ua1sLyLvJw6A2uhsh6SS6UfpEd+imXfFbWKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)