UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j8rvghxPZSWqqOjgDdj5Y+bOFBGBmMghufs0R1I+bSQ='
WHERE
key_id = '48cb6117cd3d5551ab0220d43ef8f98488461a59971f226558e54d8ad6729ca7'
AND (
token = 'j8rvghxPZSWqqOjgDdj5Y+bOFBGBmMghufs0R1I+bSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)