UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qOXwE4faFXwR1tdD8GDkIutbl0d5UiNAhcHJpi7NSEg='
WHERE
key_id = '99fb8971cf5ca40bbdaf4e884eb602c114d11083e9c0185c3637c0279a5175fa'
AND (
token = 'qOXwE4faFXwR1tdD8GDkIutbl0d5UiNAhcHJpi7NSEg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)