UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6LPiWuXnupfHd+bMy5/bdJWRegDTfaXQzmbbgmX4Xgo='
WHERE
key_id = '311d99fef61657c107886f9aa1a9cf05ab44c1ed180bef5fd8e409b6b122c81f'
AND (
token = '6LPiWuXnupfHd+bMy5/bdJWRegDTfaXQzmbbgmX4Xgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)