UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TWKTZr5nRnrO1iOxUfrpXtZTdEYhhyYSiIOnjJJlpJ4='
WHERE
key_id = '056a770abf3f7120d03181b7940f2931752492009ef1a608aeaabb3b1d4025be'
AND (
token = 'TWKTZr5nRnrO1iOxUfrpXtZTdEYhhyYSiIOnjJJlpJ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)