UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L9u66dJp148VdvzEgRS4bXwjWfZYZEyZKSmn264D/NY='
WHERE
key_id = '129df2e8877436fe3a4fe6dad4c9393b0b01ba0c4b5588c42e400b3c5d77036c'
AND (
token = 'L9u66dJp148VdvzEgRS4bXwjWfZYZEyZKSmn264D/NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)