UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4ddZRUPxMsjX62bx2fGhLNXtGf601WLjEkNRUWa0kHs='
WHERE
key_id = 'b8702bbe91dea614812707722ae6bf49ccd1acb77aa73101ce065e1d3b6ed118'
AND (
token = '4ddZRUPxMsjX62bx2fGhLNXtGf601WLjEkNRUWa0kHs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)