UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QH1GJwcV+wt2JNt6mH0HZN/BqzRm6t6e0iKVdLjtmBg='
WHERE
key_id = '495b22ae14e9c6f5761ba319a2ae50b5b2239e30ff73c227dff44bfac89549d8'
AND (
token = 'QH1GJwcV+wt2JNt6mH0HZN/BqzRm6t6e0iKVdLjtmBg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)