UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KalqJ6jfNTB/ploQvzhqd4BY6ZQdLJhXTDEy0P6ibIA='
WHERE
key_id = '5770c7a61676e869c3f5a55f61fbbac72977a9c6786d529c283386b38bc53d3b'
AND (
token = 'KalqJ6jfNTB/ploQvzhqd4BY6ZQdLJhXTDEy0P6ibIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)