UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XX7rqQytTPZDZGGR6k0j742wvK0uRkEniZtJYX2lVuY='
WHERE
key_id = '2dff508b8989efcde332fecc2dc109d3016ce4453e649482bfd97cef9ee111b5'
AND (
token = 'XX7rqQytTPZDZGGR6k0j742wvK0uRkEniZtJYX2lVuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)