UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '05f0XG2zS2179VwBdB3Fr5dnUXvrGUtZ+T82oEH2x40='
WHERE
key_id = 'd87c5a71d7b1ba988c531b55532a8d05da42945c12a1452e8361693e92d8c60d'
AND (
token = '05f0XG2zS2179VwBdB3Fr5dnUXvrGUtZ+T82oEH2x40='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)