UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jb5BWLUbGe5PMVoBbIVltiWeXA9EDSiDyKJAdcHW4eU='
WHERE
key_id = 'b376abb7ce4185019d1c0c2ac5c706e49c2dfc8d2b83e136c082539884ef47d5'
AND (
token = 'Jb5BWLUbGe5PMVoBbIVltiWeXA9EDSiDyKJAdcHW4eU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)