UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8NWFtwhrjJ+slsDjh60m3fOjj2yn2rb9L5xKUNdmA+8='
WHERE
key_id = '4e83cdf9f25694e285f8c3dd1c4bc77e43cd0bbaafbfc020625117f09e812804'
AND (
token = '8NWFtwhrjJ+slsDjh60m3fOjj2yn2rb9L5xKUNdmA+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)