UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DCLCsU43CcGNzw8AoHOGK1NlX1mIvzt+wZw0p8FlACI='
WHERE
key_id = 'bc087beba3c35b59270817c6b42683724c22aada01ed234802dfe3f36558a966'
AND (
token = 'DCLCsU43CcGNzw8AoHOGK1NlX1mIvzt+wZw0p8FlACI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)