UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z4iT/U8b5ql8Qb6ZB0By8S3odroLcpgfd0PqnSyahsg='
WHERE
key_id = '396d9b17b7ca73d411bec1acd66479cd45efe3ba3d94352c81e1b6c8717be593'
AND (
token = 'Z4iT/U8b5ql8Qb6ZB0By8S3odroLcpgfd0PqnSyahsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)