UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+TapGmZcZ9oq8wp9r+lP+skU4tDwPmEb3HrTi2XauaU='
WHERE
key_id = '0be7dcf8b005283d63ab0bd3319e5cf0c4b47a7cf05fb8ba537f85bdc33ef03a'
AND (
token = '+TapGmZcZ9oq8wp9r+lP+skU4tDwPmEb3HrTi2XauaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)