UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4UATDUe136PUIEPlw3yq5PdYY4BTQQVxps+A9HQScsI='
WHERE
key_id = '58a234d275f4e6d8ae4d3f76a5a30d6cc92e52bd1e862018e92e09944a1171c1'
AND (
token = '4UATDUe136PUIEPlw3yq5PdYY4BTQQVxps+A9HQScsI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)