UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pX/TLj6n+dURSjOtqgoe+oVbr5hvhCLcXKUWPmGNtQo='
WHERE
key_id = '5048d2644eae4785cfefd2009102b55a01afd83d95a016d1bf7441164ea436ac'
AND (
token = 'pX/TLj6n+dURSjOtqgoe+oVbr5hvhCLcXKUWPmGNtQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)